body {
    background-color: #2c3e50;
    color: #ecf0f1;
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#app-container {
    text-align: center;
    max-width: 600px;
}

h1 {
    font-family: 'Press Start 2P', cursive;
    color: #f1c40f;
    margin-bottom: 10px;
}

p {
    margin-bottom: 30px;
    font-size: 1.1em;
}

#controls {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

input[type="file"] {
    display: none;
}

.custom-file-upload {
    border: 2px solid #3498db;
    display: inline-block;
    padding: 8px 15px;
    cursor: pointer;
    background-color: #2980b9;
    color: white;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.custom-file-upload:hover {
    background-color: #2980b9;
}

#file-name {
    font-style: italic;
    color: #bdc3c7;
    background-color: #95a5a6;
    cursor: not-allowed;
}

#video-url {
    padding: 8px 12px;
    background-color: #34495e;
    color: white;
    border: 2px solid #3498db;
    border-radius: 5px;
    font-family: 'Arial', sans-serif;
    outline: none;
}

#video-url::placeholder {
    color: #bdc3c7;
}

#convert-btn {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    background-color: #27ae60;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#convert-btn:hover {
    background-color: #229954;
}

#convert-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#download-btn {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    background-color: #3498db;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#download-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

#download-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#gameboy-container {
    perspective: 1000px;
}

#gameboy {
    background-color: #d1d1d1;
    border: 2px solid #aaa;
    border-radius: 10px 10px 40px 10px;
    padding: 25px;
    width: 380px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5), inset 0 0 5px rgba(255,255,255,0.5);
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.5s ease;
}

.top-details {
    position: absolute;
    top: 10px;
    right: 25px;
    display: flex;
    gap: 3px;
    font-weight: bold;
}

.top-details .line {
    width: 2px;
    height: 15px;
    background-color: #9e9e9e;
}

#screen-container {
    background-color: #8b959d;
    border-radius: 5px;
    padding: 15px;
    padding-bottom: 30px;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5);
    position: relative;
    margin-bottom: 30px;
}

.power-light {
    width: 10px;
    height: 10px;
    background-color: #f00;
    border-radius: 50%;
    position: absolute;
    top: 30px;
    left: -8px;
    border: 2px solid #8b959d;
    box-shadow: 0 0 5px #f00;
}

.screen-text-top {
    font-size: 8px;
    color: #444;
    text-align: center;
    margin-bottom: 5px;
    font-family: sans-serif;
    font-weight: bold;
}

#gameboy-screen {
    background-color: #9bbc0f;
    width: 320px;
    height: 288px;
    display: block;
    margin: 0 auto;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

#loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0f380f;
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    text-shadow: 1px 1px #8bac0f;
    display: none; /* Controlled by JS */
}

.brand-text {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.nintendo-font {
    font-family: 'Press Start 2P', cursive;
    color: #4a5d6a;
    font-size: 14px;
    transition: all 0.3s ease;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
}

.d-pad {
    width: 90px;
    height: 90px;
    position: relative;
    background-color: #333;
    border-radius: 50%;
    justify-content: center;
    font-weight: bold;
    padding-top: 5px;
    transition: all 0.3s ease;
}
.d-pad > div {
    background-color: #555;
    position: absolute;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.d-pad-up { width: 30px; height: 30px; top: 0; left: 30px; border-radius: 5px 5px 0 0; }
.d-pad-down { width: 30px; height: 30px; bottom: 0; left: 30px; border-radius: 0 0 5px 5px; }
.d-pad-left { width: 30px; height: 30px; top: 30px; left: 0; border-radius: 5px 0 0 5px; }
.d-pad-right { width: 30px; height: 30px; top: 30px; right: 0; border-radius: 0 5px 5px 0; }
.d-pad-center { width: 30px; height: 30px; top: 30px; left: 30px; background-color: #444; }

#console-select {
    padding: 8px 12px;
    background-color: #34495e;
    color: white;
    border: 2px solid #3498db;
    border-radius: 5px;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

#console-select:hover {
    border-color: #5dade2;
}

.start-select {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    width: 100%;
}
.select-button, .start-button {
    width: 40px;
    height: 15px;
    background-color: #8b959d;
    border: 2px solid #555;
    border-radius: 10px;
    transform: rotate(-25deg);
}

.button-label {
    position: absolute;
    bottom: -15px;
    font-size: 10px;
    font-weight: bold;
    color: #4a5d6a;
    font-family: sans-serif;
}
.button-label:nth-of-type(1) { left: 130px; }
.button-label:nth-of-type(2) { right: 130px; }
.button-label.gameboy-advance { bottom: -20px; }
.button-label.gameboy-advance:nth-of-type(1) { left: calc(50% - 60px); }
.button-label.gameboy-advance:nth-of-type(2) { left: calc(50% + 20px); }

.speaker {
    position: absolute;
    bottom: 20px;
    right: 30px;
    width: 60px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    transform: rotate(-45deg);
}
.speaker-hole {
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #777 20%, #999 80%);
    border-radius: 50%;
}

/* Console Specific Styles */

/* Gameboy Color */
#gameboy.gameboy-color {
    background-color: #4b0082; /* Indigo */
}
#gameboy.gameboy-color .brand-text .nintendo-font {
    color: #f8a8b0;
    -webkit-text-stroke: 1px #a02040;
}
#gameboy.gameboy-color .screen-text-top {
    color: #e0e0e0;
}
#gameboy.gameboy-color .power-light {
    box-shadow: 0 0 8px #f00, 0 0 12px #f00;
}

/* Gameboy Light */
#gameboy.gameboy-light {
    background-color: #c0c0c0; /* Silver */
}
#gameboy.gameboy-light #gameboy-screen {
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.4), 0 0 20px #c8ffc8, 0 0 30px #c8ffc8;
}

/* Gameboy Advance */
#gameboy.gameboy-advance {
    flex-direction: row;
    width: 600px;
    height: 350px;
    padding: 20px;
    border-radius: 20px;
}
#gameboy.gameboy-advance #screen-container {
    order: 2;
    margin: 0 20px;
    padding: 10px;
    padding-bottom: 25px;
}
#gameboy.gameboy-advance .d-pad { order: 1; position: static; transform: none; }
#gameboy.gameboy-advance .ab-buttons { order: 3; position: static; transform: rotate(0); right: 0; }
#gameboy.gameboy-advance .start-select { order: 4; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: auto; gap: 20px;}
#gameboy.gameboy-advance .top-details, #gameboy.gameboy-advance .speaker { display: none; }
#gameboy.gameboy-advance .power-light { top: 10px; left: -15px; }
#gameboy.gameboy-advance .brand-text { bottom: 3px; }

/* Nintendo DS */
#ds-top-screen {
    background-color: #b0b0b0;
    border: 2px solid #999;
    border-radius: 10px 10px 0 0;
    width: 434px; /* Match the bottom part */
    box-sizing: border-box;
    margin: 0 auto;
    box-shadow: 5px -5px 15px rgba(0,0,0,0.3);
}
#ds-top-screen #gameboy-screen {
    width: 100%;
    height: auto;
}
#ds-hinge {
    width: 434px;
    height: 20px;
    background-color: #909090;
    border-left: 2px solid #777;
    border-right: 2px solid #777;
}

#gameboy.nintendo-ds {
    border-radius: 0 0 10px 10px;
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 20px;
}
#gameboy.nintendo-ds #screen-container {
    display: block;
    width: 256px;
    height: 192px;
    background: #111;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.8);
    order: 2;
    padding: 0;
}
#gameboy.nintendo-ds #bottom-screen-canvas {
    width: 100%;
    height: 100%;
}
#gameboy.nintendo-ds .controls-container {
    flex-direction: column;
    order: 1;
    gap: 20px;
    padding: 0;
    justify-content: center;
    height: 100%;
}
#gameboy.nintendo-ds .d-pad { position: static; }
#gameboy.nintendo-ds .ab-buttons { position: static; transform: none; }
#gameboy.nintendo-ds .start-select { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); }
#gameboy.nintendo-ds .top-details, #gameboy.nintendo-ds .brand-text, #gameboy.nintendo-ds .power-light, #gameboy.nintendo-ds .speaker, #gameboy.nintendo-ds .screen-text-top {
    display: none;
}

#korn-section {
    margin-top: 50px;
}

#korn-section h2 {
    font-family: 'Press Start 2P', cursive;
    color: #f1c40f;
    margin-bottom: 20px;
    line-height: 1.5;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border: 3px solid #f1c40f;
    border-radius: 10px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}